<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layui</title>
    <link rel="stylesheet" href="./layui/css/layui.css">
    <script src="./layui/layui.js"></script> </head>

<body>
    <!-- 引入好layer.js后，直接用即可 -->
    <script src="layer.js"></script>
    <script>
        layer.msg('hello'); 
    </script>
    <script>
        layui.use('layer', function () {
            var layer = layui.layer;

            layer.msg('hello');
        });   
    </script> </body>

</html>